import getState from "@/api/state";
import ZuiEchart from "@/template/zuiEchart/zuiEchart";

import ColoredDots from "@/template/ColoredDots/ColoredDots";
import ColumnColored from "@/template/columnColored/columnColored";
import React from "react";
import { useEffect } from "react";
import { useState } from "react";

const Base9 = ({ condition }) => {
    const [message, setMessage] = useState("暂无数据");
    const [loading, setLoading] = useState(false)
    const [state, setState] = useState({
        data: [
            // {
            //     "name": "大专",
            //     "value": 233,
            // },
            // {
            //     "name": "本科",
            //     "value": 13,
            // },
            // {

            //     "name": "研究生",
            //     "value": 13,

            // }
        ]
    }
    )


    useEffect(() => {
        getState({
            setMessage,
            state,
            apiUrl: "/cifgp-core-api/baseQuery/pieChart",
            condition: { ...condition, cType: "education", },
            setState,
            setLoading
        })
    }, [condition])


    return (
        <>
            {/* <ColumnColored
                loading={loading}
                style={{ width: "40%", height: "300px" }}
                title="学历分布"
                hideBtn
                data={
                    [
                        state
                    ]
                }

            /> */}
            <ZuiEchart
                 message={message}
                 loading={loading}
                style={{ width: "40%", height: "300px" }}
                title="学历分布"
                data={[state]}
                defaultModule="pie"
                pieType={"2"}
            />
        </>
    )
}
export default Base9;